<template>
  <!-- 未绑定首页 -->
  <div class="page">
    <img
      mode=""
      :src="external_contact.avatar"
      style="width: 72px;height: 72px;align-self: center;"
    >
    </img>
    <span style="font-size: 16px;font-weight: bold;text-align: center;margin-top: 12px;">{{external_contact.name}}</span>
    <span style="font-size: 14px;text-align: center;margin-top: 20px;">渠道来源:{{external_contact.type == 1?'微信':'企业微信'}}</span>
    <div
      @click="btnClickHandle(0)"
      style="height: 44px;background-color: #ff0000;text-align: center;line-height: 44px;border-radius: 8px;margin-top: 12px;color: #FFFFFF;
      cursor: pointer;
      "
    >
      标记为学生</div>
    <div
      @click="btnClickHandle(2)"
      style="height: 44px;background-color: #FFFFFF;text-align: center;line-height: 44px;border-radius: 8px;margin-top: 12px;
		border: 1px solid #FF0000;color: #FF0000;cursor: pointer;
		"
    >绑定已有学生</div>
    <!-- <div
      @click="btnClickHandle(1)"
      style="height: 44px;background-color: #FFFFFF;text-align: center;line-height: 44px;border-radius: 8px;margin-top: 12px;
		border: 1px solid #FF0000;color: #FF0000;
		
    >测试已经有数据的</div> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      external_contact: {
        external_userid: "",
        gender: 1,
        name: "",
        avatar:"",
        type: -1,
      },
    };
  },
  mounted(){
      let str = sessionStorage.getItem("external_contact")
      this.external_contact = JSON.parse(str)
      console.log(str)
  },

  methods: {
    btnClickHandle(idx) {
      let arr = [
        "/bindasbusiness",
        "/personinfo-hasbindbusiness",
        "/personinfo-bindstudent",
      ];

      if (idx == 1) {
        this.$router.push({
          name: "personinfo-hasbindbusiness",
          params: {
            actHead: "string",
            actHeadCode: 0,
            addDetail: "string",
            asdHead: "string",
            asdHeadCode: 0,
            backEmail: "string",
            birthAdd: "string",
            chnName: "string",
            chnSource: "渠道来源111",
            city: "string",
            colAdd: "string",
            colBtime: "2021-11-08T06:04:02.851Z",
            colCredit: 0,
            colCty: "string",
            colDegree: "string",
            colEduCredit: 0,
            colEtime: "2021-11-08T06:04:02.851Z",
            colMinorPro: "string",
            colName: "string",
            colPga: "string",
            colReadPro: "string",
            country: "string",
            createBy: "string",
            createTime: "2021-11-08T06:04:02.851Z",
            dateBirth: "2021-11-08T06:04:02.851Z",
            deleted: 0,
            eduType: "string",
            email: "string",
            engLevel: "string",
            engScore: 0,
            engTime: "2021-11-08T06:04:02.851Z",
            followRate: 0,
            givenName: "string",
            headUrl: "string",
            hschBtime: "2021-11-08T06:04:02.851Z",
            hschCity: "string",
            hschCty: "string",
            hschEtime: "2021-11-08T06:04:02.851Z",
            hschlName: "string",
            id: 0,
            interDegree: "string",
            liveBtime: "2021-11-08T06:04:02.851Z",
            livePostCode: "string",
            localPhone: "string",
            nationality: "string",
            openid: "string",
            osPhone: "string",
            paperNum: "string",
            papersType: 0,
            postalCode: "string",
            province: "string",
            purpose:
              '[ { "id": "新增默认传0", "school": "意向学校1", "project": "意向项目", "course": "意向课程", "authStatus": "课程认证状态", "认证截图地址": "authUrl", "failCause": "失败原因" }, { "id": "新增默认传0", "school": "意向学校2", "project": "意向项目", "course": "意向课程", "authStatus": "课程认证状态", "认证截图地址": "authUrl", "failCause": "失败原因" } ]',
            relaAdd: "string",
            remark: "string",
            saleHead: "string",
            saleHeadCode: 0,
            sex: 0,
            stuName: "szw",
            stuPurposes: [
              {
                authStatus: "string",
                authUrl: "string",
                buspId: 0,
                course: "string",
                createBy: "string",
                createTime: "2021-11-08T06:04:02.851Z",
                deleted: 0,
                failCause: "string",
                id: 0,
                project: "string",
                remark: "string",
                school: "string",
                updateBy: "string",
                updateTime: "2021-11-08T06:04:02.851Z",
              },
            ],
            stuReminds: [
              {
                buspId: 0,
                createBy: "string",
                createTime: "2021-11-08T06:04:02.851Z",
                deleted: 0,
                id: 0,
                nextTime: "2021-11-08T06:04:02.851Z",
                remark: "string",
                remindRate: 0,
                remindType: "string",
                updateBy: "string",
                updateTime: "2021-11-08T06:04:02.851Z",
              },
            ],
            stuTranscriptAdds: [
              {
                addDetail: "string",
                backEmail: "string",
                buspId: 0,
                city: "string",
                county: "string",
                createBy: "string",
                createTime: "2021-11-08T06:04:02.851Z",
                curDetail: "string",
                curUrl: "string",
                deleted: 0,
                email: "string",
                id: 0,
                postalCode: "string",
                province: "string",
                recAdd: "string",
                recName: "string",
                recPhone: "string",
                remark: "string",
                semester: "string",
                trackName: "string",
                trackNum: "string",
                trackStatus: 0,
                tranType: 0,
                updateBy: "string",
                updateTime: "2021-11-08T06:04:02.851Z",
              },
            ],
            surname: "string",
            transcriptAdd: "string",
            unionid: "string",
            updateBy: "string",
            updateTime: "2021-11-08T06:04:02.851Z",
            urgEmail: "string",
            urgLag: "string",
            urgName: "string",
            urgPhone: "string",
            urgRelative: "string",
            visaType: "string",
            wxUserId: "string",
          },
        });

        return;
      }

      console.log(arr[idx]);

      this.$router.push({
        path: arr[idx],
      });
    },
  },
};
</script>

<style scoped>
.page {
  background-color: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
</style>
